//
//  EmotionViewCell.m
//  SinaWebo
//
//  Created by wwj on 16/5/17.
//  Copyright © 2016年 亦心. All rights reserved.
//

#import "EmotionViewCell.h"
#import "EmotionModel.h"

@interface EmotionViewCell()
@property (weak, nonatomic) IBOutlet UIButton *emotionBtn;

@end

@implementation EmotionViewCell
- (void)setEmotion:(EmotionModel *)emotion{
    _emotion = emotion;
    [self.emotionBtn setImage:nil forState:UIControlStateHighlighted];
    
    if (emotion.chs) {
        [self.emotionBtn setImage:[UIImage imageNamed:emotion.emtionPath] forState:UIControlStateNormal];
    }else{
        [self.emotionBtn setImage:nil forState:UIControlStateNormal];
    }
    
    if (emotion.emtionStr) {
        [self.emotionBtn setTitle:emotion.emtionStr forState:UIControlStateNormal];
    }else{
        [self.emotionBtn setTitle:@"" forState:UIControlStateNormal];
    }
    
    
    if (emotion.isDelete) {
        [self.emotionBtn setTitle:@"" forState:UIControlStateNormal];
        [self.emotionBtn setImage:[UIImage imageNamed:@"compose_emotion_delete"] forState:UIControlStateNormal];
        [self.emotionBtn setImage:[UIImage imageNamed:@"compose_emotion_delete_highlighted"] forState:UIControlStateHighlighted];
    }
}

@end
